package com.hgkj.cloud.base.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.hgkj.cloud.base.common.PageInfo;
import com.hgkj.cloud.base.dao.TenantConsultDetailMapper;
import com.hgkj.cloud.base.domain.TenantConsultDetail;
import com.hgkj.cloud.base.service.TenantConsultDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class TenantConsultDetailServiceImpl implements TenantConsultDetailService {

	@Autowired
	private TenantConsultDetailMapper consultDetailMapper;

	@Override
	public TenantConsultDetail selectByPrimaryKey(Long id) {
		return consultDetailMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKeySelective(TenantConsultDetail record) {
		return consultDetailMapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public List<TenantConsultDetail> listByConsultId(PageInfo pi, Map<String, Object> map) {
		if(pi != null){
			map.put("currentCount", pi.getCurrentCount());
			map.put("pageSize", pi.getPageSize());
		}
		return consultDetailMapper.listByConsultId(map);
	}

	@Override
	public int insertConsultDetail(TenantConsultDetail record) {
		return consultDetailMapper.insertSelective(record);
	}

	@Override
	public List<TenantConsultDetail> listConsultDetailById(Map<String, Object> map) {
		return consultDetailMapper.listConsultDetailById(map);
	}

	@Override
	public long getListByConsultIdCount(Map<String, Object> map) {
		return consultDetailMapper.getListByConsultIdCount(map);
	}

	@Override
	public Page<TenantConsultDetail> getAllConsultDetail(Integer pageNum, Integer pageSize, Map map) {
		PageHelper.startPage(pageNum,pageSize);
		return consultDetailMapper.getAllConsultDetail(map);
	}

}
